<template>
  <el-dialog :visible.sync="visible" :title="title" custom-class="dialog_big">
    <div v-loading="loading">
      <ex_super_desc v-bind="baseOption" :data="form" :attrs="$dialogDetailDescAttrs" />
    </div>
  </el-dialog>
</template>

<script>
export default {
  components: {  },
  data() {
    return {
      visible: false, loading: false,
      title:"",
      form:{},
      baseOption: {
        model: [
          { key: 'code', label: 'label_warehouse_area_code' },
          { key: 'status', label: 'label_status', formatter: (r, c, v) => this.$enumShow(v, "IsAvailableStatusEnum") },
          { key: 'warehouseName', label: 'label_warehouse_name' },
          { key: 'areaCode', label: 'label_warehouse_area_code' },
          { key: 'alleyCode', label: 'label_tunnel_code' },
          { key: 'shelfFloor', label: 'label_shelf_floor' },

          { key: 'skuType', label: 'label_sku_type', },
          { key: 'maxBoxNum', label: 'label_maximum_number_boxes', },
          { key: 'maxBoardNum', label: 'label_minimum_number_pallet', },

          { key: 'mixFlag', label: 'label_is_mix', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'mixAllowBatchFlag', label: 'label_is_mix_batch', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },

          { key: 'length', label: 'label_length', formatter: (r, c, v, i) => `${v}cm` },
          { key: 'width', label: 'label_width', formatter: (r, c, v, i) => `${v}cm` },
          { key: 'height', label: 'label_height', formatter: (r, c, v, i) => `${v}cm` },
          { key: 'weight', label: 'label_weight', formatter: (r, c, v, i) => `${v}kg` },
          { key: 'volume', label: 'label_capacity', formatter: (r, c, v, i) => `${v}m³` },

          { key: 'coordinateX', label: 'label_x_axis', },
          { key: 'coordinateY', label: 'label_y_axis', },
          { key: 'coordinateZ', label: 'label_z_axis', },
          { key: 'locationDirect', label: 'label_warehouse_location_toward', },
          { key: 'creator', label: 'label_create_user', },
          { key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v) },


          { key: 'storageRatio', label: 'label_restriction_ratio', formatter: (r, c, v, i) => `${v}%` },
          { key: 'inboundLimitType', label: 'label_limit_inbound_type', formatter: (r, c, v) => this.$enumShow(v, "BaseLimitInboundTypeEnum") },
          { key: 'allowPick', label: 'label_allow_picking', formatter: (r, c, v) => this.$enumShow(v, "YesOrNoEnum") },
          { key: 'pickSort', label: 'label_picking_order' },
          { key: 'description', label: 'label_description', },
        ],
      },
    }
  },
  methods: {
    show({ title, params }) {
      this.loading = true
      this.visible = true
      this.title = title
      this.$ajax({
        url: '/wms-api/base/WmsBaseLocationRpc/detail.json',
        method: 'post',
        data: params,
        success: (res) => {
          this.form = Object.assign({}, res.data)
        },
        complete: () => {
          this.loading = false
        }
      })

    },


  }
}
</script>

<style scoped></style>
